import { Element } from '../../../fieldType'
import commonField from '../../../propertyPanel/commonConfig'
export interface CascadeSelectElement extends Element {
  cascadeOptions: any
  hint: string
  width: number
  configLevel: number // 配置级数
  requireLevel: number // 必填级数
}
function formListFactory () {
  return [
    commonField.name,
    commonField.attrCode,
    { label: '选项设置', name: 'cascadeOptions', type: 'cascadeSetting', data: [] },
    commonField.hint,
    commonField.width
  ]
}
const formList = formListFactory()
const formTemplate: CascadeSelectElement = {
  attrCode: '',
  businessId: '',
  name: '多级下拉',
  configLevel: 1,
  cascadeOptions: [],
  requireLevel: 1,
  fieldType: 'cascadeSelect',
  hint: '',
  width: 1
}
export default {
  formList,
  formTemplate
}
